# build stage
FROM node:lts-alpine as build-stage
WORKDIR /app
COPY package*.json .npmrc ./
RUN npm install --registry=https://registry.npm.taobao.org
COPY . .
RUN npm run build:docker

# production stage
FROM nginx:stable-alpine
COPY --from=build-stage /app/dist /usr/share/nginx/html
ADD default.conf /etc/nginx/conf.d/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]